home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 3_5.lha / 3_5 / 3_5a1.c next >
Text File  |  1993-08-08  |  379b  |  17 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / exercise division by zero
  6. include <stream.h>
  7. nt x() { return 0; }
  8.  
  9. nt main(int, char**)
  10.  
  11.    short int i = 1;
  12.    short int j = x();
  13.    short int k = i / j;    // divide by 0
  14.    cout << i << " / " << j << " = " << k << "\n";
  15.    return 0;
  16.  
  17.